package cn.accp.entity;

import java.util.Iterator;
import java.util.LinkedList;

/**
 * 集合之队类
 * 
 * @author Jiangqs
 * 
 */
public class MyQueue<T> {
	private LinkedList<T> list;

	public MyQueue() {
		list = new LinkedList<T>();
	}

	public int size() {
		return list.size();
	}

	// 入队
	public void enQueue(T obj) {
		list.push(obj);
	}

	// 出队
	public T outQueue() {
		return list.removeFirst();
	}

	public Iterator<T> iterator() {
		return list.iterator();
	}
}
